home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 30 / Amiga Format AFCD30 (Sep 1998, Issue 114).iso / -screenplay- / hd_installers / dragonwars / install < prev    next >
Text File  |  1998-06-18  |  5KB  |  219 lines

  1. ;------------------------------------------------------------
  2. ; Special installscript for Dragon Wars with patcher, by Harry
  3. ;------------------------------------------------------------
  4. ;****************************
  5.  
  6. (set #readme-file "Readme")        ;name of readme file
  7. (set #cleanup "")            ;files to delete after install
  8.  
  9. ;****************************
  10.  
  11. (if
  12.   (exists #readme-file)
  13.   (if 
  14.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  15.     ("")
  16.     (run ("SYS:Utilities/More %s" #readme-file))
  17.   )
  18. )
  19. (set #instmode
  20.   (askchoice
  21.     (prompt "Please select installation-mode")
  22.     (default 0)
  23.     (choices "Install your original (or backup) on harddisk" "Patch a backup of your original" "Install an already patched backup to harddisk")
  24.     (help @askchoice-help "\n\n Installing your original on harddisk will copy your disk to hd, then patch it.\nPatching a backup of your original requires a backup (who had ever thought this?).\nWith install an already patched backup to hd you may install a former with that script patched backup to hd.")
  25.   )
  26. )
  27. ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  28. (if
  29.   (= #instmode 1)
  30.   (
  31.     (message "Please insert now a BACKUP copy of your original in any drive.")
  32.     (set @default-dest "Backup-Disk")
  33.     (run ("patcher -p%s.param" @app-name))
  34.   )
  35. )
  36. ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  37. (if
  38.   (= #instmode 0)
  39.   (
  40.     (set @default-dest
  41.       (askdir
  42.         (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  43.         (help @askdir-help)
  44.         (default @default-dest)
  45.         (disk)
  46.       )
  47.     )
  48.  
  49.     (set #dest (tackon @default-dest @app-name))
  50.  
  51. ;if anything similar exist delete it
  52.     (if
  53.       (exists #dest)
  54.       (if
  55.     (= (askbool
  56.       (prompt "Destinationdrawer already exists, delete it?")
  57.       (help @askbool-help)
  58.         ) 1)
  59.         (run ("Delete \"%s\" \"%s.info\" all" #dest #dest))
  60.       )
  61.     )
  62.  
  63.     (makedir #dest
  64.       (help @makedir-help)
  65.       (infos)
  66.     )
  67.  
  68. ;----------------------------
  69.     (copyfiles
  70.       (help @copyfiles-help)
  71.       (source ("dw.inf"))
  72.       (newname ("dw.info"))
  73.       (dest #dest)
  74.     )
  75.     (copyfiles
  76.       (help @copyfiles-help)
  77.       (source ("DragonWars.loesung.lha"))
  78.       (dest #dest)
  79.     )
  80.     (if
  81.       (exists #readme-file)
  82.       (
  83.         (copyfiles
  84.           (help @copyfiles-help)
  85.           (source #readme-file)
  86.           (dest #dest)
  87.         )
  88.         (copyfiles
  89.           (help @copyfiles-help)
  90.           (source ("%s.info" #readme-file))
  91.           (dest #dest)
  92.         )
  93.       )
  94.     )
  95.  
  96.     (working "Please insert now your writeprotected original or backup.")
  97.  
  98.     (copyfiles
  99.       (help @copyfiles-help)
  100.       (source ("dragon.wars.1:"))
  101.       (dest #dest)
  102.       (pattern "~(s|add21k|.info|dw.info)")
  103.     )
  104.     (copyfiles
  105.       (help @copyfiles-help)
  106.       (source ("dragon.wars.2:"))
  107.       (dest #dest)
  108.       (pattern "~(.fastdir|disk.info)")
  109.     )
  110.  
  111.  
  112. ;----------------------------
  113.  
  114.     (message "Please remove your original disk(s) from the drive.")
  115.     (if
  116.       (= (exists "dragon.wars.1:" (noreq)) 2)
  117.       (abort "Quittet due not removed disk.")
  118.     )
  119.     (if
  120.       (= (exists "dragon.wars.2:" (noreq)) 2)
  121.       (abort "Quittet due not removed disk.")
  122.     )
  123.     (run ("c:assign \"dragon.wars.1:\" \"%s\"" #dest))
  124.     (run ("c:assign \"dragon.wars.2:\" \"%s\"" #dest))
  125.  
  126.     (run ("patcher -p%s.param" @app-name))
  127.  
  128.     (run ("c:assign \"dragon.wars.1:\" remove"))
  129.     (run ("c:assign \"dragon.wars.2:\" remove"))
  130.  
  131.     (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete all temporary files
  132.  
  133.   )
  134. )
  135. ;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  136. (if
  137.   (= #instmode 2)
  138.   (
  139.     (set @default-dest
  140.       (askdir
  141.         (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  142.         (help @askdir-help)
  143.         (default @default-dest)
  144.         (disk)
  145.       )
  146.     )
  147.  
  148.     (set #dest (tackon @default-dest @app-name))
  149.  
  150. ;if anything similar exist delete it
  151.     (if
  152.       (exists #dest)
  153.       (if
  154.     (= (askbool
  155.       (prompt "Destinationdrawer already exists, delete it?")
  156.       (help @askbool-help)
  157.         ) 1)
  158.         (run ("Delete \"%s\" \"%s.info\" all" #dest #dest))
  159.       )
  160.     )
  161.  
  162.     (makedir #dest
  163.       (help @makedir-help)
  164.       (infos)
  165.     )
  166.  
  167. ;----------------------------
  168.  
  169.     (copyfiles
  170.       (help @copyfiles-help)
  171.       (source ("dw.inf"))
  172.       (newname ("dw.info"))
  173.       (dest #dest)
  174.     )
  175.     (copyfiles
  176.       (help @copyfiles-help)
  177.       (source ("DragonWars.loesung.lha"))
  178.       (dest #dest)
  179.     )
  180.     (if
  181.       (exists #readme-file)
  182.       (
  183.         (copyfiles
  184.           (help @copyfiles-help)
  185.           (source #readme-file)
  186.           (dest #dest)
  187.         )
  188.         (copyfiles
  189.           (help @copyfiles-help)
  190.           (source ("%s.info" #readme-file))
  191.           (dest #dest)
  192.         )
  193.       )
  194.     )
  195.  
  196.     (working "Please insert now your writeprotected original or backup.")
  197.  
  198.     (copyfiles
  199.       (help @copyfiles-help)
  200.       (source ("dragon.wars.1:"))
  201.       (dest #dest)
  202.       (pattern "~(s|add21k|.info|dw.info)")
  203.     )
  204.     (copyfiles
  205.       (help @copyfiles-help)
  206.       (source ("dragon.wars.2:"))
  207.       (dest #dest)
  208.       (pattern "~(.fastdir|disk.info)")
  209.     )
  210.  
  211. ;----------------------------
  212.  
  213.     (run ("Delete %s ALL QUIET FORCE" #cleanup))    ;delete all temporary files
  214.  
  215.   )
  216. )
  217.  
  218. (exit)
  219.